<?php

$pg_name = basename($_SERVER['SCRIPT_FILENAME']);
$_SESSION['currentpage'] = $pg_name;
$Sqltype = "SELECT * FROM ".TABLEPREFIX."_user_type_user_relation WHERE user_id='".$_SESSION['user_id']."'";
$typeArr = $UserManagerObjAjax->GetRecords("All",$Sqltype);
$Numtype = count($typeArr);
$is_coach = 0;
$is_partner = 0;

for($t=0;$t<$Numtype;$t++)
{
   if($typeArr[$t]['user_type_id']==1)
      $is_coach = 1;
   if($typeArr[$t]['user_type_id']==3)
      $is_partner = 1;
}

$countrySql = "SELECT country_id,country_name FROM ".TABLEPREFIX."_country ORDER BY country_name";
$CountryArr = $UserManagerObjAjax->HtmlOptionArrayCreate($countrySql);

$langSql = "SELECT language_id,language_name FROM ".TABLEPREFIX."_language ORDER BY language_name";
$langArr = $UserManagerObjAjax->GetRecords("All",$langSql);

$userSql = "SELECT * FROM ".TABLEPREFIX."_user WHERE user_id='".$_SESSION['user_id']."'";
$userData = $UserManagerObjAjax->GetRecords("Row",$userSql);
$totalPoints = $userData['total_points'];


$CmsSql = "SELECT * FROM ".TABLEPREFIX."_cms WHERE cms_id = $cms_id";
$CmsArr = $UserManagerObjAjax->GetRecords("Row",$CmsSql);
$smarty->assign('Formval',$Formval);
$smarty->assign('langArr',$langArr);
$smarty->assign('language_ids',$language_ids);
$smarty->assign('CountryArr',$CountryArr);
$smarty->assign("site_url", SITE_URL);
$smarty->assign('CmsArr',$CmsArr);
$smarty->assign('totalPoints',$totalPoints);
$smarty->assign('pg_name',$pg_name);
$smarty->assign('user_id',$_SESSION['user_id']);
$smarty->assign('name',$_SESSION['name']);
$smarty->assign('user_type',$_SESSION['user_type']);
$smarty->display("top.tpl");
?>